﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Practices.Composite.Modularity;
using Microsoft.Practices.Composite.Regions;
using Microsoft.Practices.Unity;

namespace DiscoveryLogic.Analytics.Modules.Diagrams.GravityDiagrams
{
    public class GravityGraphModule:IModule  
    {
        #region props
		public IUnityContainer Container { get; private set; }
		public IRegionManager RegionManager { get; private set; }
		#endregion

		#region ctor
        public GravityGraphModule(IUnityContainer container, IRegionManager regionManager)
		{
			Container = container;
			RegionManager = regionManager;
		}
		#endregion

        #region Implementation of IModule

        public void Initialize()
        {
            GravityGraphView graphView = Container.Resolve<GravityGraphView>();
            RegionManager.Regions["GravityGraphRegion"].Add(graphView);
            RegionManager.Regions["GravityGraphRegion"].Activate(graphView);
            graphView.SubscribeEventHandler(null);
        }

        #endregion
    }
}
